package com.example.design.demo.proxy;

/**
 * @author lfj
 * @date 2023/12/1 17:22
 * @description 代练者
 */
public class GamePlayerProxy01 implements IGamePlayer{

    private IGamePlayer gamePlayer;

    //通过构造函数要传递对谁代练
    public GamePlayerProxy01(IGamePlayer _gamePlayer) {
        this.gamePlayer = _gamePlayer;
    }

    @Override
    public void login(String user, String password) {
        this.gamePlayer.login(user,password);
    }

    @Override
    public void killBoss() {
        this.gamePlayer.killBoss();
    }

    @Override
    public void upgrade() {
        this.gamePlayer.upgrade();
    }
}
